﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebSite_CodeMan.Sys_CodeMan_Manage
{
    public partial class Admin_Log_Mes : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BaseClass.BaseClass.CheckState();
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        private void LoadData()
        {
            int PageCount = 0;
            int RecordCount = 0;
            RpsysLog.DataSource = BLL.LogInfo.GetAllLogInfo(PagerNote.CurrentPageIndex, PagerNote.PageSize, out PageCount, out RecordCount);
            RpsysLog.DataBind();
            PagerNote.RecordCount = RecordCount;
        }

        protected void BtnDel_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(HSelectID.Value.Trim()))
            {
                if (BLL.LogInfo.DelLogInfo(HSelectID.Value.Trim()))
                {
                    Common.MessageBox.Show(Page, "指定信息成功删除..", "Admin_Log_Mes.aspx", "suess");
                }
                else
                {
                    Common.MessageBox.Show(Page, "指定信息删除失败，请重试或联系技术人员..","error");
                }
            }
        }

        protected void PagerNote_PageChanged(object sender, EventArgs e)
        {
            LoadData();
        }

        protected void BtnAllDel_Click(object sender, EventArgs e)
        {
            if (BLL.LogInfo.DelLogInfo())
            {
                Common.MessageBox.Show(Page, "所有日志信息成功删除..", "Admin_Log_Mes.aspx", "suess");
            }
            else
            {
                Common.MessageBox.Show(Page, "所有日志信息删除失败，请重试或联系技术人员..", "error");
            }
        }
    }
}
